
Logging
PyGears built-in support for
printing messages
from pygears.sim import log
result = [[1,1],[2,2],[3,3]]
log.info(f'Formatted info
message {result})
log.info('Some Info message')
log.debug('Some Debug message')
log.error('Some Error message')
- Used to debug Pygears simulation
- Will not be translated into SystemVerilog
- If in async gear - will include simulation
cycle and gear name
- For gears that are translated into HDL ->
messages are shown only in python “sim”
mode
0 [INFO]: Formatted info message [[1,1], [2,2], [3,3]]
1 [INFO]: Some Info message
2 [DEBUG]: Some Debug message
3 [ERROR]: Some Error message
File "...", line 143, in <module>
LogException: [0], Some Error message
Info - regular information print
in the console
Debug - lower verbosity (not
printed by default)
Error - causes simulation to fail
Also available: warning, critical,
exception
106